<template>
	<view class="select-container">
		<view class="title">请选择遗嘱类型</view>
		<block v-for="(item,index) in data" :key="index">
			<button @click="handleJump(item.path)" :plain="true" class="button">{{item.title}}</button>
		</block>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: [],
				list1: [{
						title: '遗嘱登记',
						path: '/pages/agreement/index?type=0'
					},
					{
						title: '遗赠登记',
						path: '/pages/agreement/index?type=0'
					},
					{
						title: '遗赠抚养协议登记',
						path: '/pages/agreement/index?type=0'
					}
				],
				list2: [{
						title: '遗嘱查询',
						path: '/pages/index/will/search'
					},
					{
						title: '遗赠查询',
						path: '/pages/index/will/search'
					},
					{
						title: '遗赠抚养协议查询',
						path: '/pages/index/will/searchs'
					}
				]
			}
		},
		onLoad(e) {
			console.log(e);
			if (e.type == 0) {
				this.data = this.list1
			}
			if (e.type == 1) {
				this.data = this.list2
			}
		},
		methods: {
			handleJump(path) { //页面跳转
				uni.navigateTo({
					url: path
				})
			}
		}
	}
</script>

<style lang="scss">
	.select-container {
		line-height: 1;
		height: 100vh;
		background: url('@/static/images/index/select-bg.png') no-repeat;
		width: 100%;
		background-size: 100% 100%;
		overflow: hidden;

		.title {
			font-size: 44rpx;
			font-weight: bold;
			color: #FFFFFF;
			text-align: center;
			margin-top: 200rpx;
			margin-bottom: 200rpx;
		}

		.button {
			width: 590rpx;
			height: 100rpx;
			border: 1rpx solid #FFFFFF;
			border-radius: 50rpx;
			font-size: 32rpx;
			font-weight: 500;
			color: #FFFFFF;
			margin: 50rpx auto 0;
			line-height: 100rpx;
		}
	}
</style>
